<?php

namespace App\Console\Commands;

use App\Services\RabbitMQ\LXServices;
use App\Services\RabbitMQ\RabbitMQServices;
use Illuminate\Console\Command;

class RMq extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'withdrawal:consumer';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '消费提现审核通过后的消息';

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        while(true){
            $service = LXServices::getInstance();
            $queue = config("queue.connections.rabbitmq.queue");
            $response = $service->consumerMq($queue,true);
            if ($response){
                $result = json_decode($response->body,true);
                dd($result);
            }
            dd("service error");
        }
    }
}
